<?php

namespace App\Http\Controllers;

use App\Models\Customer;
use App\User;
use Illuminate\Http\Request;

class HomeController extends Controller
{
    public function index()
    {
        return view('home');
    }

    public function customers(Request $request)
    {
        return Customer::with(['group'])
            ->orderByDesc('id')
            ->paginate($request->input('limit'));
    }

    public function users(Request $request)
    {
        return User::query()
            ->orderByDesc('id')
            ->paginate($request->input('limit'));
    }
}
